package com.taxshare.purchaser.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.taxshare.mybatis.pager.PageHelp;
import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.purchaser.entity.InvoiceCollectionsDetailEntity;
import com.taxshare.purchaser.entity.InvoiceCollectionsEntity;
import com.taxshare.purchaser.mapper.InvoiceCollectionDetailMapper;
import com.taxshare.purchaser.view.dto.InvoiceCollectionsDTO;
import com.taxshare.response.beans.Response;
import org.springframework.stereotype.Service;

@Service
public class InvoiceCollectionDetailService extends ServiceImpl<InvoiceCollectionDetailMapper, InvoiceCollectionsDetailEntity> {


    public Response invoiceCollectionDetailQuery(PageRequest<InvoiceCollectionsDetailEntity> query) {
        InvoiceCollectionsDetailEntity invoiceCollections = query.getInfo();
        QueryWrapper<InvoiceCollectionsDetailEntity> detailEntityQueryWrapper = new QueryWrapper<>();
        detailEntityQueryWrapper.eq("fphm", invoiceCollections.getFphm());
        IPage<InvoiceCollectionsDetailEntity> result = PageHelp.siamplePage(this, detailEntityQueryWrapper, query.getPage(), InvoiceCollectionsDetailEntity.class);
        return Response.success(result);
//        return Response.success(invoiceDetailEntityIPage);
    }
}
